package c.x.jy.common.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class EmojiFilter {

    public static String filter(String str) {
        if(str.trim().isEmpty()){
            return str;
        }
        String pattern="[\ud83c\udc00-\ud83c\udfff]|[\ud83d\udc00-\ud83d\udfff]|[\u2600-\u27ff]";
        String reStr="";
        Pattern emoji=Pattern.compile(pattern);
        Matcher emojiMatcher=emoji.matcher(str);
        str=emojiMatcher.replaceAll(reStr);
        return str;
    }

    public static void main(String[] args){
        String a = filter("\uD83D\uDE08  \uD83D\uDE3D \uD83D\uDE40 ٩(๑^o^๑)sfda 吴3G!#$$^*&(");
        //String a = filter("吴桂荣");
        System.out.println(a);
    }

}
